<template>
  <div>
<!--    <div id="printTest">-->
<!--      <div v-for="(item, index) in data" :key="index">-->
<!--        <svg ref="barcodeList"></svg>-->
<!--        &lt;!&ndash; 换页打印 &ndash;&gt;-->
<!--        <p style="page-break-after: always"></p>-->
<!--      </div>-->
<!--    </div>-->
    <div id="printMe" style="background:red; width: 8rem;height: 6rem;font-size: 0.01rem">
      <p>葫芦娃，葫芦娃</p>
      <p>一根藤上七朵花 </p>
      <p>小小树藤是我家 啦啦啦啦 </p>
      <p>叮当当咚咚当当　浇不大</p>
    </div>
    <button v-print="'#printMe'">Print local range</button>
  </div>
</template>

<script>
import JsBarcode from 'jsbarcode'

export default {
  data() {
    return {
      printLoading: true,
      printObj: {
        id: 'printMe',
        beforeOpenCallback(vue) {
          vue.printLoading = true
          console.log('打开之前')
        },
        openCallback(vue) {
          vue.printLoading = false
          console.log('执行了打印')
        },
        closeCallback(vue) {
          console.log('关闭了打印工具')
        }
      }
    }
  }
}
</script>

